<%@page import="sql.DBManagment"%>
<%@page import="sql.record.*"%>
<%@page import="java.util.*"%>
<%@page import="java.io.File"%>
<%@page import="java.io.IOException"%>
<%	
	User loginUser = new User();
	loginUser.userName = (String) session.getAttribute("loggedUser");
	User storedUser = new User();
	try  {
		List<User> userList = DBManagment.getRecord(loginUser);
		storedUser = userList.get(0);
	}catch(Exception e){
		%>
		<script type = "text/javascript" src = "script/end_session.js"></script>		
		<%
	}
 %>
<script type = "text/javascript" src = "script/upload.js"></script>
<div class="bodytext" style="padding: 12px;">
<form name="uploadForm" class="tableForm" id="uploadForm" name="uploadForm">
	<br/>
	<fieldset>
		<legend>Control Box</legend> 
		Upload your own XLST: <input type="file" name="fileBox" id="fileBox"/>
		<input type="button" id="uploadBtn" value="Upload">
		<br/>
		<br/>
		Select your design: 
		<select name="xsltChoise" id="xsltChoise">
			<%
				File xmlDir = new File(this.getServletContext().getRealPath("xmlTable"));
				for(String s: xmlDir.list()){
					if(s.endsWith(".xsl")){
			%>
						<option value=<%="\""+s+"\""%>><%=s%></option>
			<%
					}
				}
			%>
		</select>
		
	</fieldset>
	
</form> 
</div>
<iframe src="myTable" width="100%" height="800" align="middle" frameborder = "0" id="myTableFrame">
  <p>Your browser does not support iframes.</p>
</iframe>